package com.wenhui.nzapp.ui.activity.system;

import static java.math.BigDecimal.ROUND_HALF_UP;

import android.content.Context;
import android.graphics.Path;
import android.os.Bundle;

import androidx.appcompat.app.AppCompatActivity;

import com.gzwh.weblib.bean.NzStore;
import com.gzwh.weblib.bean.Result;
import com.gzwh.weblib.utils.MyObserver;
import com.gzwh.weblib.utils.RequestUtils;
import com.wenhui.nzapp.R;
import com.wenhuitec.sysui.TitleBuilder;
import com.wenhuitec.sysui.view.OptionItemView;

import java.math.BigDecimal;
import java.util.Map;

public class ShopSetActivity extends AppCompatActivity {

    private Context mContext;

    private OptionItemView shopNameBut;

    private OptionItemView storeIdTv;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_shop_set);
        new TitleBuilder(this).setTitleText("门店信息")
//                .setLeftIco(R.drawable.yp)
                .setLeftIcoListening((view) -> finish());
        mContext = this;
        shopNameBut = findViewById(R.id.shopNameBut);
        storeIdTv = findViewById(R.id.storeIdTv);
    }

    @Override
    public void onResume() {
        super.onResume();
        RequestUtils.getStore(mContext, new MyObserver<NzStore>(mContext, false) {
            @Override
            public void onSuccess(Result<NzStore> result) {
                shopNameBut.setRightText(result.getResult().getName());
                storeIdTv.setRightText(result.getResult().getId());
            }

            @Override
            public void onFailure(Throwable e, String errorMsg) {

            }
        });
    }
}